<?php View::render('admin/layouts/meta');?>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 用户管理
    <span class="c-gray en">&gt;</span> 举报管理
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <form>
        <div class="text-c">
            <input type="text" class="input-text" style="width:200px" placeholder="举报内容" name="title" value="<?php echo $title; ?>">
            <input type="hidden" name="page" value="1"/>
            <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
    </form>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">

        </span>
        <span class="r">共有数据：<strong><?php echo $total; ?></strong> 条</span>
    </div>
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="50">ID</th>
                <th width="120">举报分类</th>
                <th>举报内容</th>
                <th>举报对象</th>
				<th width="100">添加时间</th>
                <th width="100">更新时间</th>
                <th width="100">举报动态</th>
				<th width="200">操作</th>
			</tr>
		</thead>
		<tbody>
            <?php if ($list) {
	foreach ($list as $info) {?>
			<tr class="text-c">
				<td><?php echo $info['id']; ?></td>
                <td><?php echo isset($reasonList[$info['reason_id']]) ? $reasonList[$info['reason_id']]['title'] : $info['reason_id']; ?></td>
                <td class="text-l"><?php echo $info['reason']; ?></td>

                <td><?php echo $info['dynamic_title']; ?></td>
                <td><?php echo $info['add_time']; ?></td>
                <td><?php echo $info['update_time']; ?></td>
                <td><a href="javascript:;" style="text-decoration:none"  onclick="formAlert('举报动态','<?php echo Router::getBaseUrl(); ?>/admin_dynamic/info?dynamicId=<?php echo $info['dynamic_id']; ?>', '100%','100%')" class="">[查看]</a></td>
				<td class="td-manage">
                    <a href="javascript:;" style="text-decoration:none" onclick="formAlert('处理举报','<?php echo Router::getBaseUrl(); ?>/admin_report/sendMsg?reportId=<?php echo $info['id']; ?>', '80%','80%')" >处理</a>
                    <a href="javascript:;" style="text-decoration:none"  class="j_del ml-5" rel="<?php echo $info['id']; ?>">忽略</a>
                </td>
			</tr>
            <?php }}?>
		</tbody>
	</table>
        <div>
            <?php echo $pageHtml; ?>
        </div>
	</div>
</div>
</body>
<?php View::render('admin/layouts/footer');?>
<script type="text/javascript">
$(function(){
    window.formAlert = function(title, url, w, h) {
        layer.open({
            type: 2,
            title: title,
            area: [w, h],
            content: url,
            end: function(){
               window.location.href=location.href;
            }
          });
    }
    $('.j_del').click(function(){
        var id = $(this).attr('rel');
        $.post('<?php echo Router::getBaseUrl(); ?>/admin_report/delete', {reportId:id}, function (result) {
                if (result.status == 200) {
                    layer.msg(result.msg, {
                        icon: 1,
                        skin: 'u-msg',
                        time: 1800,
                    },function() {
                        window.location.href = location.href;
                        return true;
                    });
                }else{
                    layer.msg(result.msg, {
                        icon: 0,
                        skin: 'u-msg',
                        time: 2200,
                    });
                }
            }, 'json');
        return;
    });
});
</script>
</html>